<template>
    <div>
        <div class="login register">
            <div class="container">
                <div class="row justify-content-center">
                    <div class="col-xl-5 col-lg-5">
                        <div class="part-form">
                            <h3 class="login-title">保单号 -- {{ this.$route.query.number }}</h3>
                            <div>
                                <i-input type="text" placeholder="请输入报案电话" v-model="phone"></i-input>
                                <i-input v-model="desc" type="textarea" :autosize="{minRows: 3,maxRows: 5}"
                                         placeholder="请描述大致详情（如重疾险的病情，意外险发生的事故情况）..."></i-input>


                                <router-link to="/face_verify">
                                    <i-button type="success" style="margin-top: 50px; width: 150px"
                                              @click="to_faceVerify">确 认
                                    </i-button>
                                </router-link>
                                <router-link to="/report_policy">
                                    <i-button type="info" style="margin-top: 50px;margin-left:85px; width: 150px">返 回
                                    </i-button>
                                </router-link>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
  import eventBus from "../eventBus";

  export default {
    name: "ReportDetails",
    components: {},
    data() {
      return {
        phone: '',
        desc: '',
        number: null
      }
    },
    mounted() {
      eventBus.$on('myevent', function (dt) {
        this.phone = dt;
      })
    },
    methods: {
      to_faceVerify() {
        this.$http.post('/user/register', this.$qs.stringify({
          username: this.username,
          password: this.password,

        })).then(res => {
          if (res.status === 200) {
            if (res.data.code === 200) {
              this.$router.push('/home')
            } else {
              this.$Message.error(res.data.msg)
            }
          } else {
            this.$Message.error(res.status.toString())
          }
        })
      }
    },
    created() {
      this.number = this.$route.query.number;
    }
  }
</script>

<style scoped>
    .part-form form input {
        font-size: 20px;
    }

    .part-form form input::placeholder {
        font-size: 15px;
    }
</style>